<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0"/>
    <meta name="format-detection" content="telephone=no" />
    <title>登录</title>
    <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css"/>
</head>
<body>
<div class="container" id="container">

<div class="weui-cells__title">请输入微信绑定的手机号</div>
<div class="weui-cells weui-cells_form">
    <form th:action="@{/wework/users/login}" id="login_form" method="post">
        <div class="weui-cell">
            <div class="weui-cell__hd">
                <label class="weui-label">学号</label>
            </div>
            <div class="weui-cell__bd">
                <input id="xh" name="xh" class="weui-input" th:value="${xh}"
                       type="tel" placeholder="请输入学号"/>
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd">
                <label class="weui-label">密码</label>
            </div>
            <div class="weui-cell__bd">
                <input id="pwd" name="pwd" class="weui-input" th:value="${pwd}"
                       type="password" placeholder="请输入密码"/>
            </div>
        </div>
    </form>
</div>
<div class="weui-msg__opr-area" style="margin: 0 auto;padding: 15px 0;width: 80%;">
    <p class="weui-btn-area">
        <a id="submit_btn" onclick="login_check()" class="weui-btn weui-btn_primary">确认提交</a>
    </p>
</div>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/libs/weuijs/1.1.3/weui.min.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script th:inline="javascript">
    function login_check() {
        let name = $("#name").val();
        let pwd = $("#pwd").val();
        if (name==""||pwd==""){
            weui.alert('用户名或密码不能为空！');
        }else {
            weui.confirm('是否进行下一步？', {
                title: '提示',
                buttons: [{
                    label: '取消',
                    type: 'default',
                    onClick: function(){

                    }
                }, {
                    label: '确认',
                    type: 'primary',
                    onClick: function(){
                        $("#submit_btn").attr("disabled", "disabled");
                        $("#submit_btn").html("已提交");
                        $("#login_form").submit();
                    }
                }]
            });
        }

    }
</script>
</html>